package net.lzzy.practices.web.models;

import lombok.Getter;
import lombok.Setter;
import net.lzzy.practices.entities.Applicant;

import java.util.Date;
import java.util.UUID;

/**
 * @author m
 */
@Getter
@Setter
public class VmApplicant  {
    private final UUID id;
    private  final  int status;

    private  final Date applyTime;

    private  final  UUID courseId;

    private final  String name;

    private  final String cover;

    private  final  String desc;

    private  final  Date createTime;

    private  final  Date updateTime;

    private final String teacherName;

    private  final  String teacherAvatar;

    private  final  String studentName;

    private  final  String studentAvatar;

    public VmApplicant(Applicant applicant){
        this.id =applicant.getId();
        this.status = applicant.getStatus();
        this.applyTime = applicant.getApplyTime();
        this.courseId = applicant.getCourse().getId();
        this.name = applicant.getCourse().getName();
        this.cover = applicant.getCourse().getCover();
        this.desc = applicant.getCourse().getDescription();
        this.createTime = applicant.getCourse().getCreateTime();
        this.updateTime = applicant.getCourse().getUpdateTime();
        this.teacherName = applicant.getCourse().getTeacher().getNickName();
        this.teacherAvatar = applicant.getCourse().getTeacher().getAvatar();
        this.studentName = applicant.getStudent().getNickName();
        this.studentAvatar = applicant.getStudent().getAvatar();

    }
}
